package com.wjerp.tplus.server.api.request;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.util.CollectionUtils;

import java.util.Date;
import java.util.List;

/**
 * @author lishuailei
 */
@ApiModel("查询发票列表入参")
public class QueryInvoiceListRequest extends BaseRequestPage{

    @ApiModelProperty("企业编码")
    private String companyCode;

    @ApiModelProperty("发票代码")
    private String invoiceCode;

    @ApiModelProperty("发票号码")
    private String invoiceNumber;

    @ApiModelProperty("报销人员编码")
    private String reimburseMemberCode;

    @ApiModelProperty("开票日期(范围)")
    private List<String> invoiceDateRange;


    @ApiModelProperty("录入日期（范围）")
    private List<String> inputDate;

    @ApiModelProperty("录入人员编码")
    private String inputMemberCode;

    @JsonIgnore
    private String invoiceDate1;
    @JsonIgnore
    private String invoiceDate2;
    @JsonIgnore
    private String inputDate1;
    @JsonIgnore
    private String inputDate2;

    public String getInvoiceCode() {
        return invoiceCode;
    }

    public void setInvoiceCode(String invoiceCode) {
        this.invoiceCode = invoiceCode;
    }

    public String getInvoiceNumber() {
        return invoiceNumber;
    }

    public void setInvoiceNumber(String invoiceNumber) {
        this.invoiceNumber = invoiceNumber;
    }

    public String getReimburseMemberCode() {
        return reimburseMemberCode;
    }

    public void setReimburseMemberCode(String reimburseMemberCode) {
        this.reimburseMemberCode = reimburseMemberCode;
    }

    public List<String> getInvoiceDateRange() {
        return invoiceDateRange;
    }

    public void setInvoiceDateRange(List<String> invoiceDate) {
        this.invoiceDateRange = invoiceDate;
    }

    public List<String> getInputDate() {
        return inputDate;
    }

    public void setInputDate(List<String> inputDate) {
        this.inputDate = inputDate;
    }

    public String getInputMemberCode() {
        return inputMemberCode;
    }

    public void setInputMemberCode(String inputMemberCode) {
        this.inputMemberCode = inputMemberCode;
    }

    public String getInvoiceDate1() {
        return CollectionUtils.isEmpty(invoiceDateRange) ? invoiceDate1 : invoiceDateRange.get(0);
    }

    public void setInvoiceDate1(String invoiceDate1) {
        this.invoiceDate1 = invoiceDate1;
    }

    public String getInvoiceDate2() {
        return CollectionUtils.isEmpty(invoiceDateRange) ? invoiceDate2 : (invoiceDateRange.get(1)+" 23:59:59");

    }

    public void setInvoiceDate2(String invoiceDate2) {
        this.invoiceDate2 = invoiceDate2;
    }

    public String getInputDate1() {
        return CollectionUtils.isEmpty(inputDate) ? inputDate1 : inputDate.get(0);

    }

    public void setInputDate1(String inputDate1) {
        this.inputDate1 = inputDate1;
    }

    public String getInputDate2() {
        return CollectionUtils.isEmpty(inputDate) ? inputDate2 : inputDate.get(1);

    }

    public void setInputDate2(String inputDate2) {
        this.inputDate2 = inputDate2;
    }

    public String getCompanyCode() {
        return companyCode;
    }

    public void setCompanyCode(String companyCode) {
        this.companyCode = companyCode;
    }
}
